<?php include_once "inc/head.php"; ?>
<!-- JAVASCRIPT -->
<script src="/js/profile.js" type="text/javascript"></script>
<!-- CSS -->
<link href="/css/profile.css" rel="stylesheet" type="text/css" media="screen" />
</head>
<body>
<div id="wrapper">
	<?php include_once "inc/header.php"; ?>
	<!-- end #menu -->
	<div id="headerPageSplitter"><div></div></div>
	<div id="page">
		<div id="content">
		<?php
		$uid_username = Mres($_GET["u"]);
		
			if(intval($uid_username) != 0)
			{
				$uid = $uid_username;
			}
			else
			{
				$username = str_replace('@', '', $uid_username);
				
				//GET UID FROM USERNAME
				if(UsernameToUid($username) != false)
				{
					$uid = UsernameToUid($username);
				}
				else
				{
					$uid = "_"; //THIS UID DOES NOT EXIST
				}
			}
		?>
			<?php if(UserExist($uid))
			{
			?>
			<div class="padding10" id="profileWelcome">
				<img src="/assets/images/profilePics/l/noProfilePic.png" align="left" class="profileImage"/>
				<span class="profileName"><?php echo DisplayName($uid); ?></span><span class='profileUsername'> - @<?php echo Username($uid); ?></span>
					
					<?php 
					if(LoggedIn()) {
						if(IsMe($uid)){ ?>
						<a href="/settings.php" id="settingsLink">Settings</a>
					<?php } else { 
						if(IsFollowing($userID, $uid)) {
					?>
						<span id="unfollowUser" class="followUnfollow <?php echo $uid; ?>">Following</span>
						<span id="followUser" class="followUnfollow <?php echo $uid; ?>" style="display:none">Follow</span>
					<?php } else { ?> 
						<span id="unfollowUser" class="followUnfollow <?php echo $uid; ?>" style="display:none">Following</span>
						<span id="followUser" class="followUnfollow <?php echo $uid; ?>">Follow</span>
					<?php } } } ?>
					
				<div id="profileDescription">
					<p>Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum ipsum. Proin imperdiet est. Phasellus dapibus semper urna. Pellentesque ornare, orci in felis. Donec ut ante. In id eros. Suspendisse lacus turpis, cursus egestas at sem.</p>
					<!-- or nbsp; -->
				</div>
				<div id="profileTabs">
					<span class="tabOpen"><a href="javascript:void(0)" class="profileTab_newest profileTab">Newest</a></span>
					<span><a href="javascript:void(0)" class="profileTab_uploads profileTab">Uploads</a></span>
					<span><a href="javascript:void(0)" class="profileTab_info profileTab">Info</a></span>
					<span><a href="javascript:void(0)" class="profileTab_feed profileTab">Feed</a></span>
					<span><a href="javascript:void(0)" class="profileTab_following profileTab">Following</a></span>
					<span><a href="javascript:void(0)" class="profileTab_followers profileTab">Followers</a></span>
				</div>
			</div>
			<?php
			}
			else
			{
				?>
					<div class="padding20">
						No user
					</div>
				<?php
			}
			?>
		<div style="clear: both;">&nbsp;</div>
		</div>
		<!-- end #content -->
		<div id="sidebar">
			<?php include_once "inc/sidebar.php"; ?>
		</div>
		<!-- end #sidebar -->
		<div style="clear: both;height: 0px;">&nbsp;</div>
	</div>
	<!-- end #page -->
</div>
	<?php include_once "inc/footer.php"; ?>
	<!-- end #footer -->
</body>
</html>